package com.library.management.service.borrow;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.library.management.domain.borrow.Borrow;
import com.library.management.domain.borrow.vo.BorrowVO;

public interface BorrowService extends IService<Borrow> {
    
    /**
     * 分页查询借阅记录
     */
    Page<BorrowVO> getBorrowPage(Integer page, Integer size, String keyword, Integer status, Long userId);
    
    /**
     * 根据用户ID查询借阅记录
     */
    Page<BorrowVO> getBorrowByUserId(Long userId, Integer page, Integer size);
    
    /**
     * 归还图书
     */
    boolean returnBook(Long borrowId, String remarks);
    
    /**
     * 续借图书
     */
    boolean renewBook(Long borrowId, Integer renewDays);
    
    /**
     * 更新借阅状态（处理逾期）
     */
    void updateBorrowStatus();
    
    /**
     * 借阅图书
     */
    boolean borrowBook(Long userId, Long bookId, Integer borrowDays, String remarks);

} 